import java.util.Arrays;

public class Bigram 
{
    

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + Arrays.hashCode(bigramArr);
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	Bigram other = (Bigram) obj;
	if (!Arrays.equals(bigramArr, other.bigramArr))
	    return false;
	return true;
    }

    private String[] bigramArr;
    
    
    
    private Bigram(String pos1, String pos2)
    {
	bigramArr = new String[2];
	bigramArr[0]= pos1;
	bigramArr[1]= pos2;
    }
    
    public static Bigram newBigram(String pos1, String pos2)
    {
	Bigram newBigram = new Bigram(pos1, pos2);
	return newBigram;
    }
    
    public String getPOS1()
    {
	return bigramArr[0];
    }
    
    public String getPOS2()
    {
	return bigramArr[1];
    }
    
    public String[] getBigram()
    {
	
	return this.bigramArr;
    }
    
    public String toString()
    {
	String output = "POS 1 is: " + getPOS1() + " POS 2 is: " + getPOS2();
	return output;
    }
    
}
